#include <iostream>

using namespace std;

template <class T>
void g(T x)
{
    cout << x << " ";
}

void f() {}

template <class T, class... Tail>
void f(T head, Tail... tail)
{
    g(head);    // 打印head
    f(tail...); // 再次处理tail
}

int main(int argc, char const *argv[])
{
    cout << "first: ";
    f(1, 2.2, "hello");
    cout << "\nsecond: ";
    f(0.2, 'c', "yuck!", 0, 1, 2);
    return 0;
}
